﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<Bastanteo.Domain.Usuario>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Creacion
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Creacion</h2>

    <% Html.EnableClientValidation(); %>
    <% using (Html.BeginForm("Crear", "Usuario", FormMethod.Post)) {%>
        <%: Html.ValidationSummary(true) %>

        <fieldset>
            <legend>Datos del alumno</legend>
            <div class="editor-label">
                Código
            </div>
            <div class="editor-field">
                <%: Html.TextBoxFor(model => model.Codigo) %>
                <%: Html.ValidationMessageFor(model => model.Codigo) %>
            </div>
            
            <div class="editor-label">
                Usuario
            </div>
            <div class="editor-field">
                <%: Html.TextBoxFor(model => model.usuario) %>
                <%: Html.ValidationMessageFor(model => model.usuario) %>
            </div>
            
            <div class="editor-label">
                Contraseña
            </div>
            <div class="editor-field">
                <%: Html.TextBoxFor(model => model.Password) %>
                <%: Html.ValidationMessageFor(model => model.Password) %>
            </div>
            <div class="editor-label">
                Rol
            </div>
            <div class="editor-field">
                <%: Html.DropDownList("rolCodigo", (IEnumerable<SelectListItem>)TempData["Roles"]) %>
            </div>
            
            <p>
                <input type="submit" value="Create" />
            </p>
        </fieldset>

    <% } %>

    <div>
        <%: Html.ActionLink("Back to List", "Index") %>
    </div>

</asp:Content>

